package com.shoppingwebsite.dao;

import com.shoppingwebsite.domain.YtOrders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderDao {
    //添加一条订单
    @Insert("insert into yt_orders(userName,goodsAll,totalPrice,address,lxfs,buyTime) values(#{userName},#{goodsAll},#{totalPrice},#{address},#{lxfs},now())")
    public void add(YtOrders orders);

    //得到所有订单信息
    @Select("select *from yt_orders where userName = #{username}")
    public List<YtOrders> getOrders(String username);
}
